def index():
    form=SQLFORM(db.message,fields=['your_name','your_email','your_message'])
    if form.accepts(request.vars,session):
       subject='A visitor message from '+form.vars.your_name
       email_user(sender=form.vars.your_email,\
                  text=form.vars.your_message)
       response.flash='your message has been submitted'
    elif form.errors:
       response.flash='please check the form and try again'
    return dict(top_message=TOP_MESSAGE,form=form)
